package com.hcxdi.api.bean.card;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by jiajiabao on 16-11-16.
 */

public class CardInfo implements Parcelable{
    private int bankName;
    private Boolean isCurrent;
    private int subBankName;
    private String cardNumber;
    private int cardType;
    private long createDate;
    private int id;
    private String name;
    private int userId;

    public int getBankName() {
        return bankName;
    }

    public void setBankName(int bankName) {
        this.bankName = bankName;
    }

    public Boolean getIsCurrent() {
        return isCurrent;
    }

    public void setIsCurrent(Boolean isCurrent) {
        this.isCurrent = isCurrent;
    }

    public int getSubBankName() {
        return subBankName;
    }

    public void setSubBankName(int subBankName) {
        this.subBankName = subBankName;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }


    public int getCardType() {
        return cardType;
    }

    public void setCardType(int cardType) {
        this.cardType = cardType;
    }

    public long getCreateDate() {
        return createDate;
    }

    public void setCreateDate(long createDate) {
        this.createDate = createDate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.bankName);
        dest.writeValue(this.isCurrent);
        dest.writeInt(this.subBankName);
        dest.writeString(this.cardNumber);
        dest.writeInt(this.cardType);
        dest.writeLong(this.createDate);
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.userId);
    }

    public CardInfo() {
    }

    protected CardInfo(Parcel in) {
        this.bankName = in.readInt();
        this.isCurrent = (Boolean) in.readValue(Boolean.class.getClassLoader());
        this.subBankName = in.readInt();
        this.cardNumber = in.readString();
        this.cardType = in.readInt();
        this.createDate = in.readLong();
        this.id = in.readInt();
        this.name = in.readString();
        this.userId = in.readInt();
    }

    public static final Parcelable.Creator<CardInfo> CREATOR = new Parcelable.Creator<CardInfo>() {
        @Override
        public CardInfo createFromParcel(Parcel source) {
            return new CardInfo(source);
        }

        @Override
        public CardInfo[] newArray(int size) {
            return new CardInfo[size];
        }
    };
}
